<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />

    <script type="text/javascript" src="/static/h-ui/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/h-ui/lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="/static/h-ui/js/H-ui.js"></script>
    <script type="text/javascript" src="/static/h-ui/js/H-ui.admin.page.js"></script>
</head>

<body>
    <div class="cl pd-5 bg-1 bk-gray">
        <a href="javascript:void(0);" class="btn btn-primary radius sethumb">
            <i class="Hui-iconfont">&#xe600;</i> 站内选择 </a>&nbsp;&nbsp;
        <a href="{:url('/file_manager/uploadpicture')}" class="btn btn-default radius sethumb">
            <i class="Hui-iconfont">&#xe600;</i> 本地上传 </a>&nbsp;&nbsp;
        <a href="{:url('/file_manager/onlinepicture')}" class="btn btn-default radius sethumb">
            <i class="Hui-iconfont">&#xe600;</i> 网络图片 </a>&nbsp;&nbsp;
    </div>
    <div class="step0 active" style="display:block;">
        <table class="table table-border table-bordered table-bg">
            <thead>
                <tr class="text-c">
                    <th width="50%" background="/static/admin/images/linebg.gif">
                        <strong>文件名</strong>
                    </th>
                    <th width="10%" background="/static/admin/images/linebg.gif">
                        <strong>文件大小</strong>
                    </th>
                    <th width="32%" background="/static/admin/images/linebg.gif">
                        <strong>最后修改时间</strong>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-c" bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                    <td>
                        <a href="selectpicture?activepath={$data.activeurl}&step=1">
                            <img src=/static/admin/images/dir2.gif border=0 width=16 height=16 align=absmiddle> 上级目录</a>
                    </td>
                    <td colspan="2">当前目录:<span style="color:#f00;"> uploads{$data.activepath} </span></td>
                </tr>
                {foreach $data.dirs as $dir}
                <tr class="text-c" style="height:26px; " onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                    <td style="text-align:left;">
                        <a href="selectpicture?activepath={$data.activepath}/{$dir}&step=1">
                            <img src=/static/admin/images/dir.gif border=0 width=16 height=16 align=absmiddle>{$dir}
                        </a>
                    </td>
                    <td></td>
                    <td></td>
                </tr>
                {/foreach} {foreach $data.files as $file}
                <tr class="text-c" bgcolor='#FFFFFF' height='26px' onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                    <td style="text-align:left;">
                        <a href="javascript:void(0);" onClick="preview('{$data.activepath}/{$file[\'name\']}')" title="点击查看">
                            <img src="/static/admin/images/{$file['extension']}.gif" border=0 width=16px height=16px align=absmiddle>{$file['name']}</a>
                    </td>
                    </td>
                    <td align='center'> {$file['size']} </td>
                    <td align='center'> {$file['time']}&nbsp;&nbsp;
                        <a href='javascript:void(0);' onclick="preview('{$data.activepath}/{$file[\'name\']}')"
                            class="btn">预览</a>
                    </td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <div id="showdiv" style="width:400px;height:300px;position:fixed;top:20%; left:20%;background:#fcfdfd;box-shadow:1px 8px 10px 1px #9b9b9b;border-radius:1px;  z-index:999;display:none; ">
            <input type="hidden" name="pImgname" id="pImgname" value="">
            <div class="tiptop" style="background-color:#5A98DE;text-align:center;height:36px">
                <span style="color:#fff">图片预览</span>
                <a onClick="$('#showdiv').css('display', 'none')" style="display:block; background:url(/static/admin/images/close.png) no-repeat; width:22px; height:22px;float:right;margin-right:7px; margin-top:10px; cursor:pointer;"></a>
            </div>
            <div class="tipimg" style="width:300px;height:190px;margin-left:40px;margin-top:20px;">
                <img id="showimg" src="" width="300" height="200px">
            </div>
            <div class="tipbtn" style="float:right;margin-top:10px;;margin-right:30px;">
                <input name="" type="button" class="btn btn-primary radius" value="选定" onClick="selectImg()" />&nbsp;
                <input name="" type="button" class="btn btn-default radius" value="取消" onClick="$('#showdiv').css('display','none')" />
            </div>
        </div>
    </div>
    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript">
        // 预览图片
        function preview(imageName) {
            url = '/uploads/' + imageName;

            $("#showdiv").css('display', 'block');
            $("#showimg").attr('src', url);
        }

        // 选定图片
        function selectImg() {
            // var imageName=$("#pImgname").val();
            var imageUrl = $("#showimg").attr('src');
            window.parent.$("#showthumb").attr('src',imageUrl);
            window.parent.$("#thumb").val(imageUrl);
            layer_close();
        }
    </script>
    <!--请在上方写此页面业务相关的脚本-->
</body>

</html>